
varying vec2 vUv;
uniform sampler2D uTexture;
uniform sampler2D uTexture1;
uniform sampler2D uTexture2;
varying float vImgIndex;
varying vec3 vColor;
void main(){
    // gl_FragColor = vec4(vUv,0.0,1.0);

    // gl_PointCoord 一个二分量向量，在顶点上对纹理坐标进行插值用于采样应用在点精灵上的2D纹理。
    // gl_FragColor = vec4(gl_PointCoord,0.0,1.0);

    // 渐变圆
    // float strenght = distance(gl_PointCoord,vec2(0.5));
    // strenght*=2.0;
    // strenght = 1.0 - strenght;
    // gl_FragColor = vec4(strenght);


    // 圆
    // float strenght = 1.0 - distance(gl_PointCoord,vec2(0.5));
    // strenght = step(0.5,strenght);
    // gl_FragColor = vec4(strenght);

    //根据纹理设置图案
    // vec4 textureColor =texture2D(uTexture,gl_PointCoord);
    // gl_FragColor = textureColor;
    // gl_FragColor = vec4(textureColor.rgb,textureColor.r);

    
    vec4 textureColor;
    if(vImgIndex == 0.0){
        textureColor =texture2D(uTexture,gl_PointCoord);
    }else if(vImgIndex == 1.0){
        textureColor =texture2D(uTexture1,gl_PointCoord);
    }else{
        textureColor =texture2D(uTexture2,gl_PointCoord);
    }

    // gl_FragColor = vec4(gl_PointCoord,1.0,textureColor.r);
    gl_FragColor = vec4(vColor,textureColor.r);

}